declare @tabla nvarchar(100)
		,@qry nvarchar(100)
		,@max nvarchar(max)
		,@columna nvarchar(100)
declare @temp table (nombre varchar(100),maximo nvarchar(max))
declare qtablas cursor for
	--select QUOTENAME(name)
		--from sys.tables
		select sys.tables.name, sys.columns.name
	from sys.tables  join sys.columns  
		on sys.tables.object_id= sys.columns.object_id
	where sys.columns.column_id=1
open qtablas
fetch next from qtablas INTO @tabla,@columna
while @@FETCH_STATUS=0
begin
	set @qry=N'select @maximo = max('+@columna+') from ' + quotename(@tabla)
	exec sp_executesql @qry, N'@maximo nvarchar(100) output', @maximo = @max output
	insert into @temp
		values (@tabla,@max)
	fetch next from qtablas into @tabla,@columna
end
select*
from @temp